<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>登录</title>
    <script src="./js/jQuery.min.js"></script>
</head>

<body>
    <div>
        <h1>登录</h1>
        <div>
            <div>
                <span>账号</span>
                <input type="text" id="username">
            </div>
            <div>
                <span>密码</span>
                <input type="password" id="password">
            </div>
            <button onclick="login()">登录</button>
        </div>
    </div>

</body>

<script>
    //登录
    function login() {
        var username = jQuery("#username").val();
        var password = jQuery("#password").val();

        jQuery.ajax({
            type: "POST",
            url: "/user/login",
            data: {
                "username": username,
                "password": password
            },
            success: function (data) {
                alert(data);
            }
        });

    }
</script>

</html>